<?php

#
#
#

class Settings
{
    var $db_provider;
	var $db_host;
	var $db_username;
	var $db_password;
	var $db_database;
	
	var $domain;
	
	public function __construct()
	{
		$this->loadSettings();
	}

	private function loadSettings()
	{		
		if( ! file_exists($_SERVER["DOCUMENT_ROOT"]."/conf/conf.ini") )  
			Logger::getInstance()->log("/conf/conf.ini file not found in Settings::loadSettings");
		else {
			$settings = parse_ini_file($_SERVER["DOCUMENT_ROOT"]."/conf/conf.ini", true);
			$this->db_provider = $settings["database"]["provider"];
			$this->db_host     = $settings["database"]["host"];
			$this->db_username = $settings["database"]["username"];
			$this->db_password = $settings["database"]["password"];
			$this->db_database = $settings["database"]["db"];
			$this->domain      = "http://".$settings["other"]["domain"]."/";
		}
	}
	
};
?>